package com.wzb.springboot001.controller;

import com.ljx.springboot001.entity.Student;
import com.ljx.springboot001.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ljx.springbootcommon.utils.R;
import java.util.List;

@RestController
@RequestMapping("/student")
@CrossOrigin
public class studentController {
    @Autowired
    private StudentService studentService;
    @GetMapping("/list")
    public R findStudent(){
        List<Student> list = studentService.list();
        return R.ok().code(200).data("studentList",list);
    }
}
